package com.example.lihaoqian

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.example.lihaoqian.AddWordFragment
import com.example.lihaoqian.WordListFragment

class AddWordFragment {

}

class ViewPagerAdapter(fragmentActivity: FragmentActivity?) :
    FragmentStateAdapter(fragmentActivity!!) {
    override fun createFragment(position: Int): Fragment {
        return if (position == 0) WordListFragment() else AddWordFragment()
    }

    override fun getItemCount(): Int {
        return 2
    }
}